class MultiHopFlight
  def initialize(hops=[])
    @hops = hops
  end
  def add_hop(airport)
    @hops << airport
  end
  # @return True if this multihop flight visits the given airport
  def visits?(airport)
    return @hops.include?(airport)
  end

  def from
    return @hops.first
  end

  # @return The destination of the multihop flight
  def destination
    return @hops.last
  end

  # @return a clone of the list with the airports where this multiflight passes by
  def hops
    return @hops.clone
  end
  
  def hop_count
    return @hops.length
  end

  def to_s
    return @hops.join("-")
  end
end
